package Menu
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.Event;
	import flash.text.TextField;
	public final class CreateMenu extends Sprite
	{
		private var pageManager:PageManager;
		
		public function CreateMenu()
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE,init);
		}
		private function init(e:Event=null):void{
			removeEventListener(Event.ADDED_TO_STAGE,init);
			
			pageManager=new PageManager();
			addChild(pageManager);

			pageManager.registerPage(new MenuPage(new MenuComponent()));
			pageManager.registerPage(new PlayPage(new GameComponent()));
			pageManager.registerPage(new AuthorsPage(new AuthorsComponent()));
			pageManager.registerPage(new HelpPage(new InstructionsComponent()));
			pageManager.showPage(MenuPage);
		}
	}
}